<?php 
/**
 * @author Eugenio Fage
 * http://eugeniofage.wordpress.com/
 * http://code.google.com/p/monky/
 * 
 */
 
$class[0]=' ';
$class[1] = ' class="altrow"';
$i=0;
?>
<div class="users view">
<h2><?php  __('User') ?></h2>
	<dl>
	    <?php $i++; ?>
		<dt<?=$class[$i%2]; ?>><?php __('Username'); ?></dt>
		<dd<?=$class[$i%2] ?>>
			<?php echo $user['User']['username']; ?>
			&nbsp;
		</dd>
		<?php $i++; ?>
		<dt<?=$class[$i%2] ?>><?php __('Registered'); ?></dt>
		<dd<?=$class[$i%2] ?>>
			<?php echo $this->Time->timeAgoInWords($user['User']['created']) ?>
			&nbsp;
		</dd>
		<?php $i++; ?>
		<dt<?=$class[$i%2] ?>><?php __('Level'); ?></dt>
		<dd<?=$class[$i%2] ?>>
			<?php echo $user['Group']['name']; ?>
			&nbsp;
		</dd>
		<?php $i++; ?>
		<dt<?=$class[$i%2] ?>><?php __('Ranking'); ?></dt>
		<dd<?=$class[$i%2] ?>>
			<?php echo $user['User']['ranking']; ?>
			&nbsp;
		</dd>
		<?php $i++; ?>
		<dt<?=$class[$i%2] ?>><?php __('Karma'); ?></dt>
		<dd<?=$class[$i%2] ?>>
			<?php echo $user['User']['karma']; ?>
			&nbsp;
		</dd>
		<?php $i++; ?>
		<dt<?=$class[$i%2] ?>><?php __('Calculated'); ?></dt>
		<dd<?=$class[$i%2] ?>>
			<?php echo $this->Time->timeAgoInWords($user['User']['karma_time_calculated']) ?>
			&nbsp;
		</dd>
	</dl><br />
	<p>
	<b><?php __('Karma calculation detail'); ?></b><br />
	<?php echo nl2br($this->Html->tag('span',$user['User']['karma_detail'])); ?>
	</p>
</div>
<div class="actions">
	<h3><?php __('Actions') ?></h3>
	<ul>
		<?php if($this->Session->read('Auth.User.id')==$user['User']['id']): ?>
		<li><?php echo $this->Html->link(__('Edit User', true), array('action' => 'edit', $user['User']['id'])); ?> </li>
		<?php endif; ?>
		<li><?php echo $this->Html->link(sprintf(__('View %s profile', true),$user['User']['username']), array('action' => 'view', $user['User']['id'])); ?> </li>
		<li><?php echo $this->Html->link(__('View submited links', true), array('action' => 'links', $user['User']['id'])); ?> </li>
		
		<?php 
		//@todo ver delete example
		//<li><?php echo $this->Html->link(__('View submited links', true), array('action' => 'links', $user['User']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $user['User']['id']));  </li>
		?>
	</ul>
</div>
